package edu.fiu.ann.initializer;

import java.util.Random;

/**
 * Initialize the weights of neural networks by Gaussian distribution.
 *
 * @author Yexi Jiang (http://users.cis.fiu.edu/~yjian004/)
 * @date 2011-4-4
 */
public class GaussianInitializer extends Initializer {

	@Override
	public double[][] initialize(int upStreamLayer, int downStreamlayer) {
		double[][] weightsInputToHidden = new double[upStreamLayer][downStreamlayer];
		Random random = new Random();
		for(int i = 0; i < upStreamLayer; ++i){
			for(int j = 0; j < downStreamlayer; ++j){
				weightsInputToHidden[i][j] = random.nextGaussian();
			}
		}		
		return weightsInputToHidden;
	}

}
